import 'dart:async';

import 'package:flutter_bloc/flutter_bloc.dart';

part './tian_shu_state.dart';

class TianShuCubit extends Cubit<TianShuState> {
  TianShuCubit() : super(TianShuState());

  readFile() async {
    // String value = await rootBundle.loadString('assets/files/08.json');
    // emit(state.clone(data: jsonDecode(value)));

    Future.delayed(const Duration(seconds: 1), () {
      emit(
        state.clone(
          data: [
            {
              'year': '2024',
              'events': [
                [
                  {
                    "year": "1883",
                    "title": "\u8377\u5c5e\u4e1c\u5370\u5ea6\u7fa4\u5c9b\u4e0a\u706b\u5c71\u7206\u53d1\u5f15\u8d77\u6d77\u5578",
                    "link": "https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B",
                    "type": "event",
                    "desc":
                        "\u4e1c\u5370\u5ea6\u7fa4\u5c9b\uff08\u4ea6\u79f0\u9999\u6599\u7fa4\u5c9b\uff09\u662f\u516c\u5143\u5341\u4e94\u4e16\u7eaa\u524d\u540e\u6b27\u6d32\u56fd\u5bb6\u5bf9<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%97%E4%BA%9A\">\u4e1c\u5357\u4e9a<\/a>\u76db\u4ea7\u9999\u8fa3\u6599\u7684\u5c9b\u5c7f\u7684\u6cdb\u540d\u3002\u5b83\u8bf4\u660e\u4e86\u5f53\u65f6<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E6%AC%A7%E6%B4%B2\">\u6b27\u6d32<\/a>\u4eba\u5bf9\u4e1c\u65b9\u9999\u8fa3\u6599\u7684\u6e34",
                  },
                  {
                    "year": "1883",
                    "title":
                        "\u8377\u5c5e<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B\">\u4e1c\u5370\u5ea6\u7fa4\u5c9b<\/a>\u4e0a\u706b\u5c71\u7206\u53d1\u5f15\u8d77\u6d77\u5578",
                    "link": "https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B",
                    "type": "event",
                    "desc":
                        "\u4e1c\u5370\u5ea6\u7fa4\u5c9b\uff08\u4ea6\u79f0\u9999\u6599\u7fa4\u5c9b\uff09\u662f\u516c\u5143\u5341\u4e94\u4e16\u7eaa\u524d\u540e\u6b27\u6d32\u56fd\u5bb6\u5bf9<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%97%E4%BA%9A\">\u4e1c\u5357\u4e9a<\/a>\u76db\u4ea7\u9999\u8fa3\u6599\u7684\u5c9b\u5c7f\u7684\u6cdb\u540d\u3002\u5b83\u8bf4\u660e\u4e86\u5f53\u65f6<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E6%AC%A7%E6%B4%B2\">\u6b27\u6d32<\/a>\u4eba\u5bf9\u4e1c\u65b9\u9999\u8fa3\u6599\u7684\u6e34",
                  }
                ],
                [
                  {
                    "year": "1883",
                    "month": null,
                    "day": null,
                    "title": "\u8377\u5c5e\u4e1c\u5370\u5ea6\u7fa4\u5c9b\u4e0a\u706b\u5c71\u7206\u53d1\u5f15\u8d77\u6d77\u5578",
                    "link": "https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B",
                    "type": "event",
                    "desc":
                        "\u4e1c\u5370\u5ea6\u7fa4\u5c9b\uff08\u4ea6\u79f0\u9999\u6599\u7fa4\u5c9b\uff09\u662f\u516c\u5143\u5341\u4e94\u4e16\u7eaa\u524d\u540e\u6b27\u6d32\u56fd\u5bb6\u5bf9<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%97%E4%BA%9A\">\u4e1c\u5357\u4e9a<\/a>\u76db\u4ea7\u9999\u8fa3\u6599\u7684\u5c9b\u5c7f\u7684\u6cdb\u540d\u3002\u5b83\u8bf4\u660e\u4e86\u5f53\u65f6<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E6%AC%A7%E6%B4%B2\">\u6b27\u6d32<\/a>\u4eba\u5bf9\u4e1c\u65b9\u9999\u8fa3\u6599\u7684\u6e34",
                  },
                ]
              ],
              'children': [
                {
                  'month': '1',
                  'events': [
                    [
                      {
                        "year": "1883",
                        "month": '1',
                        "day": null,
                        "title": "\u8377\u5c5e\u4e1c\u5370\u5ea6\u7fa4\u5c9b\u4e0a\u706b\u5c71\u7206\u53d1\u5f15\u8d77\u6d77\u5578",
                        "link": "https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B",
                        "type": "event",
                        "desc":
                            "\u4e1c\u5370\u5ea6\u7fa4\u5c9b\uff08\u4ea6\u79f0\u9999\u6599\u7fa4\u5c9b\uff09\u662f\u516c\u5143\u5341\u4e94\u4e16\u7eaa\u524d\u540e\u6b27\u6d32\u56fd\u5bb6\u5bf9<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%97%E4%BA%9A\">\u4e1c\u5357\u4e9a<\/a>\u76db\u4ea7\u9999\u8fa3\u6599\u7684\u5c9b\u5c7f\u7684\u6cdb\u540d\u3002\u5b83\u8bf4\u660e\u4e86\u5f53\u65f6<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E6%AC%A7%E6%B4%B2\">\u6b27\u6d32<\/a>\u4eba\u5bf9\u4e1c\u65b9\u9999\u8fa3\u6599\u7684\u6e34",
                      },
                      {
                        "year": "1883",
                        "month": '1',
                        "day": null,
                        "title":
                            "\u8377\u5c5e<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B\">\u4e1c\u5370\u5ea6\u7fa4\u5c9b<\/a>\u4e0a\u706b\u5c71\u7206\u53d1\u5f15\u8d77\u6d77\u5578",
                        "link": "https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B",
                        "type": "event",
                        "desc":
                            "\u4e1c\u5370\u5ea6\u7fa4\u5c9b\uff08\u4ea6\u79f0\u9999\u6599\u7fa4\u5c9b\uff09\u662f\u516c\u5143\u5341\u4e94\u4e16\u7eaa\u524d\u540e\u6b27\u6d32\u56fd\u5bb6\u5bf9<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%97%E4%BA%9A\">\u4e1c\u5357\u4e9a<\/a>\u76db\u4ea7\u9999\u8fa3\u6599\u7684\u5c9b\u5c7f\u7684\u6cdb\u540d\u3002\u5b83\u8bf4\u660e\u4e86\u5f53\u65f6<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E6%AC%A7%E6%B4%B2\">\u6b27\u6d32<\/a>\u4eba\u5bf9\u4e1c\u65b9\u9999\u8fa3\u6599\u7684\u6e34",
                      }
                    ],
                    [
                      {
                        "year": "1883",
                        "month": null,
                        "day": null,
                        "title": "\u8377\u5c5e\u4e1c\u5370\u5ea6\u7fa4\u5c9b\u4e0a\u706b\u5c71\u7206\u53d1\u5f15\u8d77\u6d77\u5578",
                        "link": "https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B",
                        "type": "event",
                        "desc":
                            "\u4e1c\u5370\u5ea6\u7fa4\u5c9b\uff08\u4ea6\u79f0\u9999\u6599\u7fa4\u5c9b\uff09\u662f\u516c\u5143\u5341\u4e94\u4e16\u7eaa\u524d\u540e\u6b27\u6d32\u56fd\u5bb6\u5bf9<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%97%E4%BA%9A\">\u4e1c\u5357\u4e9a<\/a>\u76db\u4ea7\u9999\u8fa3\u6599\u7684\u5c9b\u5c7f\u7684\u6cdb\u540d\u3002\u5b83\u8bf4\u660e\u4e86\u5f53\u65f6<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E6%AC%A7%E6%B4%B2\">\u6b27\u6d32<\/a>\u4eba\u5bf9\u4e1c\u65b9\u9999\u8fa3\u6599\u7684\u6e34",
                      },
                    ]
                  ],
                  'children': [
                    {
                      'day': '1',
                      'events': [
                        [
                          {
                            "year": "1883",
                            "month": null,
                            "day": null,
                            "title": "\u8377\u5c5e\u4e1c\u5370\u5ea6\u7fa4\u5c9b\u4e0a\u706b\u5c71\u7206\u53d1\u5f15\u8d77\u6d77\u5578",
                            "link": "https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B",
                            "type": "event",
                            "desc":
                                "\u4e1c\u5370\u5ea6\u7fa4\u5c9b\uff08\u4ea6\u79f0\u9999\u6599\u7fa4\u5c9b\uff09\u662f\u516c\u5143\u5341\u4e94\u4e16\u7eaa\u524d\u540e\u6b27\u6d32\u56fd\u5bb6\u5bf9<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%97%E4%BA%9A\">\u4e1c\u5357\u4e9a<\/a>\u76db\u4ea7\u9999\u8fa3\u6599\u7684\u5c9b\u5c7f\u7684\u6cdb\u540d\u3002\u5b83\u8bf4\u660e\u4e86\u5f53\u65f6<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E6%AC%A7%E6%B4%B2\">\u6b27\u6d32<\/a>\u4eba\u5bf9\u4e1c\u65b9\u9999\u8fa3\u6599\u7684\u6e34",
                          },
                        ],
                        [
                          {
                            "year": "1883",
                            "month": null,
                            "day": null,
                            "title": "\u8377\u5c5e\u4e1c\u5370\u5ea6\u7fa4\u5c9b\u4e0a\u706b\u5c71\u7206\u53d1\u5f15\u8d77\u6d77\u5578",
                            "link": "https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B",
                            "type": "event",
                            "desc":
                                "\u4e1c\u5370\u5ea6\u7fa4\u5c9b\uff08\u4ea6\u79f0\u9999\u6599\u7fa4\u5c9b\uff09\u662f\u516c\u5143\u5341\u4e94\u4e16\u7eaa\u524d\u540e\u6b27\u6d32\u56fd\u5bb6\u5bf9<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%97%E4%BA%9A\">\u4e1c\u5357\u4e9a<\/a>\u76db\u4ea7\u9999\u8fa3\u6599\u7684\u5c9b\u5c7f\u7684\u6cdb\u540d\u3002\u5b83\u8bf4\u660e\u4e86\u5f53\u65f6<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E6%AC%A7%E6%B4%B2\">\u6b27\u6d32<\/a>\u4eba\u5bf9\u4e1c\u65b9\u9999\u8fa3\u6599\u7684\u6e34",
                          },
                          {
                            "year": "1883",
                            "month": null,
                            "day": null,
                            "title":
                                "\u8377\u5c5e<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B\">\u4e1c\u5370\u5ea6\u7fa4\u5c9b<\/a>\u4e0a\u706b\u5c71\u7206\u53d1\u5f15\u8d77\u6d77\u5578",
                            "link": "https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%B0%E5%BA%A6%E7%BE%A4%E5%B2%9B",
                            "type": "event",
                            "desc":
                                "\u4e1c\u5370\u5ea6\u7fa4\u5c9b\uff08\u4ea6\u79f0\u9999\u6599\u7fa4\u5c9b\uff09\u662f\u516c\u5143\u5341\u4e94\u4e16\u7eaa\u524d\u540e\u6b27\u6d32\u56fd\u5bb6\u5bf9<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E4%B8%9C%E5%8D%97%E4%BA%9A\">\u4e1c\u5357\u4e9a<\/a>\u76db\u4ea7\u9999\u8fa3\u6599\u7684\u5c9b\u5c7f\u7684\u6cdb\u540d\u3002\u5b83\u8bf4\u660e\u4e86\u5f53\u65f6<a target=\"_blank\" href=\"https:\/\/baike.baidu.com\/item\/%E6%AC%A7%E6%B4%B2\">\u6b27\u6d32<\/a>\u4eba\u5bf9\u4e1c\u65b9\u9999\u8fa3\u6599\u7684\u6e34",
                          }
                        ]
                      ],
                    }
                  ],
                }
              ]
            }
          ],
        ),
      );
    });
  }
}
